import {defineStore} from 'pinia'
import { reqSwiperList} from '../api/recommend'

/* 使用defineStore函数创建一个Store并暴露,接收两个参数,第一个参数是Store名称,相当于模块名,第二个是配置对象,配置State,actions,getters */
export const useRecommendStore = defineStore('recommend',{
  state:()=>({
    recommend:[] as any,
  }),
  actions:{
    async getSwiperList(){
       let {data:{navList}} = await reqSwiperList()
        for(let i=0;i<7;i++){
          this.recommend[i]=[navList[i],navList[i+7]]        
        }        
    },
  },
  getters:{}
})
